package com.tzm.demo;

public class Test3 {

  public static void main(String[] args) {
    Stu stu1 = new Stu();
    stu1.age = 20;

    Stu stu2 = new Stu();
    stu2.age = 30;

    swap(stu1, stu2);

    System.out.println(stu1.age + ", " + stu2.age);
  }

  public static void swap(Stu a, Stu b) {
    Stu tmp = a;
    a = b;
    b = tmp;
  }

  static class Stu {
    int age;
  }
}

